package com.pump.data;

import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.function.Consumer;

public class PumpTestSourceData {
	
	private Double dia;
	private List<Map<String, Double>> powerDataList ;
	private List<Map<String, Double>> npshrDataList ;
	


	public Double getDia() {
		return dia;
	}

	public void setDia(Double dia) {
		this.dia = dia;
	}

	public List<Map<String, Double>> getPowerDataList() {
		return powerDataList;
	}

	public void setPowerDataList(List<Map<String, Double>> powerDataList) {
		
		powerDataList.sort(new Comparator<Map<String,Double>>()
		{

			public int compare(Map<String, Double> o1, Map<String, Double> o2) {
				return Double.compare(o1.get("q"),o2.get("q"));
			}
			
		});
		
		this.powerDataList = powerDataList;
	}

	public List<Map<String, Double>> getNpshrDataList() {
		return npshrDataList;
	}

	public void setNpshrDataList(List<Map<String, Double>> npshrDataList) {
		npshrDataList.sort(new Comparator<Map<String,Double>>()
		{

			public int compare(Map<String, Double> o1, Map<String, Double> o2) {
				return Double.compare(o1.get("q"),o2.get("q"));
			}
			
		});
		this.npshrDataList = npshrDataList;
	}

	@Override
	public String toString() {
		return "PumpTestSourceData [dia=" + dia + ", powerDataList=" + powerDataList + ", npshrDataList="
				+ npshrDataList + "]";
	}


	
}
